package task15;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner Sc= new Scanner(System.in);
        System.out.println("请输入m值：");
        int m = Sc.nextInt();
        System.out.println("请输入n值：");
        int n = Sc.nextInt();
        int result=he(m,n);
        System.out.println("偶数和是："+result);

    }

    private static int he(int m, int n) {
        int sum=0;
        for(int i=m;i<n;i++){
            if(i%2==0){
                sum=sum+i;
            }
        }
        System.out.println(sum);
        return sum;
    }
}
